package com.explorati.LeetCode26.removeDuplicates;

/**
 * @ Author : Weijian_Wang
 * @ Date : Created in 22:30 2020/9/21 0021
 * @ Description ：
 */
public class Solution1 {
    public int removeDuplicates(int[] nums) {
        int i = 0;
        for(int j = 1; j < nums.length; j++) {
            if(nums[i] != nums[j]) {
                i ++;
                nums[i] = nums[j];
            }
        }

        return i + 1;
    }
}
